/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cpasl;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.HPos;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;

/**
 *
 * @author seanm_000
 */
public class ThankYouGridPane extends GridPane {
    
    public ThankYouGridPane() {
        setAlignment(Pos.CENTER);
        setHgap(15);
        setVgap(15);
        
        ColumnConstraints column1 = new ColumnConstraints();
        column1.setHalignment(HPos.CENTER);
        getColumnConstraints().add(column1); 
        
        Label thankYouLabel = new Label("Thank you for participating.");
        
        Button nextButton = new Button();
        nextButton.setText("Quit");
        nextButton.setId("quit-button");
        nextButton.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent event) {
                CpaslManager.getInstance().writeQuestionnaire();
                CpaslManager.getInstance().shutdown();
            }
        });
        
        add(thankYouLabel, 0, 0);
        add(nextButton, 0, 1);
    }
    
}
